Skip to content

Comments

hplip: fix plugin fetch#391529

Merged
SuperSandro2000 merged 3 commits intoNixOS:masterfrom
psentee:fix-hplip-fetch
Mar 23, 2025
Merged

hplip: fix plugin fetch#391529
SuperSandro2000 merged 3 commits intoNixOS:masterfrom
psentee:fix-hplip-fetch

Conversation

@psentee
Copy link
Contributor

@psentee psentee commented Mar 20, 2025

HP now returns 403 for unrecognized user-agents:

building '/nix/store/r9airhak8ic5pqpmbl7v9ixv1sif43rn-hplip-3.24.4-plugin.run.drv'...
error: builder for '/nix/store/r9airhak8ic5pqpmbl7v9ixv1sif43rn-hplip-3.24.4-plugin.run.drv' failed with exit code 1;
       last 19 log lines:
       >
       > trying https://developers.hp.com/sites/default/files/hplip-3.24.4-plugin.run
       >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       >                                  Dload  Upload   Total   Spent    Left  Speed
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 403
       > Warning: Problem (retrying all errors). Will retry in 1 seconds. 3 retries
       > Warning: left.
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 403
       > Warning: Problem (retrying all errors). Will retry in 2 seconds. 2 retries
       > Warning: left.
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 403
       > Warning: Problem (retrying all errors). Will retry in 4 seconds. 1 retries
       > Warning: left.
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 403
       > error: cannot download hplip-3.24.4-plugin.run from any mirror
       For full logs, run 'nix log /nix/store/r9airhak8ic5pqpmbl7v9ixv1sif43rn-hplip-3.24.4-plugin.run.drv'.

This change sets fetch user-agent to Firefox prefix (bare 'Mozilla/5.0' wasn't enough).

Also adds plugin source as a second source instead of a closed-over binding so it's possible to read and override it from outside (e.g. point at internal mirror or vendor the file).

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Mar 20, 2025
@nix-owners nix-owners bot requested a review from ttuegel March 20, 2025 10:05
HP now returns 403 for unrecognized user-agents, set it to Firefox
prefix (bare 'Mozilla/5.0' wasn't enough).

Also adds `plugin` as a derivation parameter instead of a closed-over
binding so it's possible to `overrideAttrs` it (e.g. point at internal
mirror or vendor the file).
@github-actions github-actions bot removed the 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. label Mar 23, 2025
@SuperSandro2000 SuperSandro2000 merged commit 60b7c9f into NixOS:master Mar 23, 2025
33 of 35 checks passed
@raboof raboof mentioned this pull request Mar 24, 2025
13 tasks
@Atemo-C Atemo-C mentioned this pull request Mar 25, 2025
3 tasks
nixpkgs-ci bot pushed a commit that referenced this pull request Apr 1, 2025
(cherry picked from commit 60b7c9f)
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Apr 1, 2025

Successfully created backport PR for release-24.11:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants